<%@page contentType="text/html;charset=utf-8"%>
<%@taglib prefix="s"  uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>当当图书 – 全球最大的中文网上书店</title>
		<link href="../css/book.css" rel="stylesheet" type="text/css" />
		<link href="../css/second.css" rel="stylesheet" type="text/css" />
		<link href="../css/secBook_Show.css" rel="stylesheet" type="text/css" />
		<link href="../css/list.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="../js/jquery-1.5.1.min.js"></script>
		<script type="text/javascript">
			function buy(id){
				$.ajax({
					type:'post',
					url:'../cart/buy.action',
					data:{'bookId':id},
					dataType:'json',
					success:function(data,status){
						if(!data){
							$('#cartinfo_'+id).html('已经添加过');
							return;
						}
					},
					error:function(xhr, textStatus, errorThrown){
						window.location='../user/login_form.jsp';
					}
				});

			}
			function change(value,cid,pid){
				window.location='booklist.action?value='+value+'&cid='+cid+'&pid='+pid;
			}
		</script>
	</head>
	<body>
		&nbsp;
	<s:debug></s:debug>
		<!-- 头部开始 -->
		<%@include file="../common/head.jsp"%>
		<!-- 头部结束 -->

		<div style="width: 962px; margin: auto;">
			<a href="#"><img src="../images/default/book_banner_081203.jpg" border="0" /> </a>
		</div>
		<div class='your_position'>
			您现在的位置:&nbsp;
			<a href='list.action'>当当图书</a> &gt;&gt;
			<font style='color: #cc3300'>
			<strong><s:property value="cateNames.get(0)"/>
			</strong>
			 </font>
			 <s:if test="cateNames.get(1)!=null">
			  &gt;&gt;
			<font style='color: #cc3300'>
			<strong><s:property value="cateNames.get(1)"/>
			</strong>
			 </font>
			 </s:if>
		</div>

		<div class="book">

			<!--左栏开始-->
			<div id="left" class="book_left">
				<div id="__fenleiliulan">
					<div class=second_l_border2>
						<h2>
							分类浏览
						</h2>
						<ul>
							<li>
								<div>
									<div class=second_fenlei>
										&middot;全部&nbsp;(${count })
									</div>
								</div>
							</li>
							<div class="clear"></div>
							
							<!--2级分类开始-->
							<s:iterator value="cates">
							<li>
								<div>
									<div class=second_fenlei>
										&middot;
									</div>
									<div class=second_fenlei>
									<s:if test="cid==id">
										<a href="booklist.action?pid=${parentId }&cid=${id}"><span style="color:red;font-style:blod;">${name }&nbsp;(${pnum})</span></a>
									</s:if>
									<s:else>
										<a href="booklist.action?pid=${parentId }&cid=${id}">${name }&nbsp;(${pnum})</a>
									</s:else>
									</div>
								</div>
							</li>
						    <div class="clear"></div>
						    </s:iterator>
							<!--2级分类结束-->
							
							<li>
								<div></div>
							</li>
						</ul>
					</div>
				</div>
			</div>

			<!--左栏结束-->

			<!--中栏开始-->
			<div class="book_center">

				<!--图书列表开始-->
				<div id="divRight" class="list_right">

					<div id="book_list" class="list_r_title">
						<div class="list_r_title_text">
							排序方式
						</div>
						<select onchange='change(this.value,${cid },${pid })' name='select_order' size='1'
							class='list_r_title_ml'>
							<s:if test="value=='add_time,desc'">
							<option value="add_time,desc" selected="selected">
								按上架时间 降序
							</option>
							</s:if>
							<s:else>
							<option value="add_time,desc">
								按上架时间 降序
							</option>
							</s:else>
							<s:if test="value=='add_time,asc'">
								<option value="add_time,asc" selected="selected">
								按上架时间 升序
								</option>
							</s:if>
							<s:else>
							<option value="add_time,asc">
								按上架时间 升序
							</option>
							</s:else>
							<s:if test="value=='publish_time,desc'">
							<option value="publish_time,desc" selected="selected">
								按出版时间 降序
							</option></s:if>
							<s:else><option value="publish_time,desc">
								按出版时间 降序
							</option></s:else>
							<s:if test="value=='publish_time,asc'">
							<option value="publish_time,asc" selected="selected">
								按出版时间 升序
							</option>
							</s:if>
							<s:else>
							<option value="publish_time,asc">
								按出版时间 升序
							</option>
							</s:else>
							<s:if test="value=='dang_price,desc'">
							<option value="dang_price,desc" selected="selected">
								按当当价格 降序
							</option>
							</s:if>
							<s:else>
							<option value="dang_price,desc">
								按当当价格 降序
							</option>
							</s:else>
							<s:if test="value=='dang_price,asc'">
							<option value="dang_price,asc" selected="selected">
								按当当价格 升序
							</option>
							</s:if>
							<s:else><option value="dang_price,asc">
								按当当价格 升序
							</option></s:else>
						</select>
						<div id="divTopPageNavi" class="list_r_title_text3">

							<!--分页导航开始-->
							<s:if test="page<=1">
							<div class='list_r_title_text3a'>
								<img src='../images/page_up_gray.gif' />
							</div>
							</s:if>
							<s:else>
							<div class='list_r_title_text3a'>
								<a name=link_page_next
									href="booklist.action?cid=${cid }&pid=${pid }&page=${page-1}">
								<img src='../images/page_up.gif' /> </a>
							</div>
							</s:else>
							<div class='list_r_title_text3b'>
								第${page }页/共${totalPage }页
							</div>
							<s:if test="page>=totalPage">
							<div class='list_r_title_text3a'>
								<img src='../images/page_down_gray.gif' />
							</div>
							</s:if>
							<s:else>
							<div class='list_r_title_text3a'>
								<a name=link_page_next
									href="booklist.action?cid=${cid }&pid=${pid }&page=${page+1}">
									<img src='../images/page_down.gif' /> </a>
							</div>
							</s:else>


							<!--分页导航结束-->
						</div>
					</div>
					
					<!--商品条目开始-->
						
						<div class="list_r_line"></div>
						<div class="clear"></div>
						<s:iterator value="books">						
						<div class="list_r_list">
							<span class="list_r_list_book"><a name="link_prd_img" href='detail.action?pid=${id }'>
								<img src="../productImages/${productPic }" /> </a> </span>
							<h2>
								<a name="link_prd_name" href='detail.action?pid=${id }'>${productName }</a>
							</h2>
							<h3>
								顾客评分：100
							</h3>
							<h4 class="list_r_list_h4">
								作 者:
								<a href='#' name='作者'>${author }</a>
							</h4>
							<h4>
								出版社：
								<a href='#' name='出版社'>${publishing }</a>
							</h4>
							<h4>
								出版时间：${publishTimeAsString }
							</h4>
							<h5>
								${authorSummary }
							</h5>
							<div class="clear"></div>
							<h6>
								<span class="del">￥${fixedPrice}</span>
								<span class="red">￥${dangPrice}</span>
								节省：￥${fixedPrice-dangPrice }
							</h6>
							
							<span class="list_r_list_button"> 
							<a href="javascript:;" onclick="buy(${id});"> 
							<img src='../images/buttom_goumai.gif' /> </a>
							<span id="cartinfo_${id}">${buy_error}</span>
						</div>
						<div class="clear"></div>
						</s:iterator>
						<!--商品条目结束-->

					<div class="clear"></div>
					<div id="divBottomPageNavi" class="fanye_bottom">
					</div>

				</div>
				<!--图书列表结束-->

			</div>
			<!--中栏结束-->
			<div class="clear"></div>
		</div>

		<!--页尾开始 -->
		<%@include file="../common/foot.jsp"%>
		<!--页尾结束 -->
	</body>
</html>
